
dyn.load("test/Gibbs.so")
#source("~/Documents/Memoire/src/Generate_Musk.R")
source("~/Documents/Memoire/src/Generate.R")
#source("~/Documents/Memoire/src/new_data.R")
M<-50000
ft<-function()
{
#p<-8
#n<-200
#library(MASS)
#X<-as.matrix(Pima.tr[,1:7])
#Y<-as.numeric(Pima.tr[,8])
#Y[Y==1]<-0
#Y[Y==2]<-1
#X<-X
#v<-apply(X,2,sd)
#m<-apply(X,2,mean)
#X<-t(apply(t(apply(X,1,"-",m)),1,"/",v))
#X<-cbind(1,X)
#source("R/Generate_Credit.R")
theta<-matrix(0, nrow=M,ncol=p)
t=proc.time()
res1<-.C("Gibbs", as.integer(M),as.integer(n),as.integer(p),as.double(Y),as.double(X),res=as.double(theta),index=as.double(matrix(0,nrow=p)),sig=as.double(matrix(0,nrow=p,ncol=p)))
cat("\n");cat("time: ")
cat((proc.time()-t))
res<-matrix(res1$res,nrow=M)
e<-res1$index
f<-res1$sig
return(list(b=res,model=e,sig=f))
}
b<-matrix(0,nrow=10,ncol=p)
for(i in 1:1)
{
res<-ft()
b[i,]<-apply(res[[1]][-(1:10000),],2,mean)
#write.table(b,"res_MH_MS_Credit.txt")
}
#dyn.unload("test/Rprob_separated.so")
#dyn.unload("test/Rinterface.so")
dyn.unload("test/Gibbs.so")
